Skip to content

update for use with eink displays, #26

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Nov 15, 2020
Merged

Conversation

ladyada
Copy link
Member

@ladyada ladyada commented Nov 14, 2020

mostly ignore no-backlight-attr and add manual refreshing on new image

test with:

import board
import pulseio
from adafruit_slideshow import PlayBackOrder, SlideShow

# pylint: disable=no-member

# Create the slideshow object that plays through once alphabetically.
slideshow = SlideShow(
    board.DISPLAY,
    None,
    folder="/",
    loop=True,
    order=PlayBackOrder.ALPHABETICAL,
    dwell=3
)

while slideshow.update():
    pass

@ladyada ladyada requested review from tannewt and FoamyGuy November 14, 2020 16:43
Copy link
Contributor

@FoamyGuy FoamyGuy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code looks good to me. Haven't tested, but will later today after my magtag arrives.

@FoamyGuy
Copy link
Contributor

@jedgarpark is interested in these changes too I believe.

@FoamyGuy
Copy link
Contributor

I tested this successfully with a build from main
image

@ladyada ladyada merged commit 9cfed13 into adafruit:master Nov 15, 2020
@ladyada
Copy link
Member Author

ladyada commented Nov 15, 2020

thankya!

Copy link
Member

@tannewt tannewt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you! Do you think it'd be clearer to check if the display is an epaper in the constructor and then use if statements to change behavior? That might be more understandable than catching an exception.

@@ -380,6 +383,8 @@ def advance(self):
)
self._group.append(sprite)

if hasattr(self._display, "refresh"):
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How does this work with a tft? It also has refresh: https://circuitpython.readthedocs.io/en/5.3.x/shared-bindings/displayio/Display.html#displayio.Display.refresh

Shouldn't you be able to call it every time?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

eink needs a force-refresh, perhaps there are some that dont have refresh? i wasnt sure... i can remove the test

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think you can call refresh on all displays. On TFTs it'll just refresh immediately when auto_refresh is on.

adafruit-adabot added a commit to adafruit/Adafruit_CircuitPython_Bundle that referenced this pull request Nov 17, 2020
Updating https://github.com/adafruit/Adafruit_CircuitPython_MagTag to 1.0.3 from 1.0.2:
  > Merge pull request adafruit/Adafruit_CircuitPython_MagTag#11 from makermelissa/main
  > Merge pull request adafruit/Adafruit_CircuitPython_MagTag#10 from makermelissa/main

Updating https://github.com/adafruit/Adafruit_CircuitPython_PyBadger to 3.2.0 from 3.1.1:
  > Merge pull request adafruit/Adafruit_CircuitPython_PyBadger#39 from FoamyGuy/add_magtag_support

Updating https://github.com/adafruit/Adafruit_CircuitPython_Slideshow to 1.4.0 from 1.3.1:
  > Merge pull request adafruit/Adafruit_CircuitPython_Slideshow#26 from ladyada/master
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants